package com.jiashihui.web.controller.swagger2;

import com.jiashihui.web.model.Dept;
import com.jiashihui.web.model.base.BaseResponse;
import com.jiashihui.web.model.base.ResultObjectResponse;
import io.swagger.annotations.*;

/**
 * describe: 接口说明
 * @author jiashihui
 * @date 2019/1/30
 */
@Api(value="部门信息")
public interface DeptApi {

    /**
     * option的value的内容是这个method的描述，notes是详细描述，response是最终返回的json model。其他可以忽略
     */
    @ApiOperation(value = "添加部门信息", notes = "添加部门信息", response = BaseResponse.class, authorizations = {
            @Authorization(value = "petstore_auth", scopes = {
                    @AuthorizationScope(scope = "add:dept", description = "add dept"),
                    @AuthorizationScope(scope = "read:dept", description = "read dept")
            })
    }, tags = {"部门信息操作接口"})
    /**
     * 参数信息
     */
    @ApiImplicitParams({
            @ApiImplicitParam(name = "dept", value = "部门信息", required = true, dataType = "dept", paramType = "body")
    })
    /**
     * 这里是显示你可能返回的http状态，以及原因。比如404 not found, 303 see other
     */
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "Successful — 请求已完成", response = BaseResponse.class),
            //@ApiResponse(code = 400, message = "请求中有语法问题，或不能满足请求", response = BaseResponse.class),
            //@ApiResponse(code = 401, message = "未授权客户机访问数据", response = BaseResponse.class),
            //@ApiResponse(code = 404, message = "服务器找不到给定的资源；文档不存在", response = BaseResponse.class),
            @ApiResponse(code = 405, message = "输入的参数不正确，请检查", response = BaseResponse.class),
            //@ApiResponse(code = 500, message = "服务器不能完成请求", response = BaseResponse.class)
    })
    BaseResponse save(Dept dept);

    /**
     * @author: jiashihui
     * @description 根据部门名称获取部门信息
     * @date: 2019/1/30 15:59
     */
    @ApiOperation(value = "根据部门名称获取部门信息", notes = "根据部门名称获取部门信息", tags = {"部门信息操作接口"})
    @ApiImplicitParam(name = "id", value = "部门名称", required = true, dataType = "String", paramType = "path")
    @ApiResponses(@ApiResponse(code = 405, message = "输入的参数不正确，请检查", response = BaseResponse.class))
    ResultObjectResponse get(Integer id);

    /**
     * @author: jiashihui
     * @description 分页获取全部部门信息
     * @date: 2019/1/30 15:59
     */
    @ApiOperation(value = "分页获取全部部门信息", notes = "分页获取全部部门信息", tags = {"部门信息操作接口"})
    @ApiImplicitParams({
            @ApiImplicitParam(name = "pageNum", value = "页码", dataType = "Integer", paramType = "query"),
            @ApiImplicitParam(name = "pageSize", value = "每页显示条数",dataType = "Integer", paramType = "query")
    })
    @ApiResponses(@ApiResponse(code = 405, message = "输入的参数不正确，请检查", response = ResultObjectResponse.class))
    ResultObjectResponse getList(Integer pageNum, Integer pageSize);

    /**
     * @author: jiashihui
     * @description 获取符合条件的部门信息
     * @date: 2019/1/30 15:59
     */
    @ApiOperation(value = "获取符合条件的部门信息", notes = "获取符合条件的部门信息", tags = {"部门信息操作接口"})
    @ApiImplicitParam(name = "dept", value = "部门信息", required = true, dataType = "dept", paramType = "body")
    @ApiResponses(@ApiResponse(code = 405, message = "输入的参数不正确，请检查", response = ResultObjectResponse.class))
    ResultObjectResponse queryUserList(Dept dept);
}